package parsers;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test {

	/**
	 * @param args
	 */
	public static int readResume(String yourResume) {
        int qualifiedCount = 0;
/*
Scanner scanResume =null;
        try {
                Candidate you = new Candidate();
                File resumeFile = new File(yourResume);
                 scanResume = new Scanner(resumeFile);
                scanResume.useDelimiter("\\Z");
                String resumeString = scanResume.next();

               

                String[] requiredSkillsArr = new String[7];
                requiredSkilsArr[0] = "2 years of programming experience";
                requiredSkilsArr[1] = "2 years of test experience, including api level testing";
                requiredSkilsArr[2] = "Ability to code in Java or eagerness to learn Java";
                requiredSkilsArr[3] = "Ability to write SQL queries";
                requiredSkilsArr[4] = "Strong testing & analytical skills.";
                requiredSkilsArr[5] = "Passion for high quality";
                requiredSkilsArr[6] = "Degree in Computer Science or Engineering field";

 

                for (int i=0; i < requiredSkillsArr.length; i++) {
                        Pattern pattern = Pattern.compile(requiredSkillsArr[i]);
                        Matcher matcher = pattern.matcher(resumeString);
                        if ( matcher.find() ) {
                                qualifiedCount+=3;
                        }
                }

            

                String[] niceToHaveSkillsArr = new String[6];
                niceToHaveSkillsArr[0] = "OOP experience";
                niceToHaveSkilsArr[1] = "Experience writing effective test automation"; 
                niceToHaveSkilsArr[2] = "Experience with load and performance testing";
                niceToHaveSkilsArr[3] = "Experience with distributed data grids and messaging systems";
                niceToHaveSkilsArr[4] = "Experience with Unix or Linux";
                niceToHaveSkilsArr[5] = "Leadership experience";

 

                for (int i=0; i < niceToHaveSkillsArr.length; i++) {
                         Pattern pattern = Pattern.compile(niceToHaveSkillsArr[i]);
                         Matcher matcher = pattern.matcher(resumeString);
                         if ( matcher.find() ) {
                                 qualifiedCount+=1;
                         }
                }

 

                

        

       } catch (IOException e) {
               e.printStackTrace();
       }
       finally
       {
    	   scanResume.close();
       }

 

       if (you.foundTheBugsInThisProgram()) {
              qualifiedCount+=3;
       }

 

    */
       return qualifiedCount;
}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try{
			System.out.println("asdfa");
		File resumeFile = new File("C:\\a.txt");
		Scanner scanResume = new Scanner(resumeFile);
		scanResume.useDelimiter("\\Z");
        System.out.println("before");
		String str = scanResume.next();
        System.out.println("after");
		//System.out.println(str);
		Pattern pattern = Pattern.compile("asdf");
        Matcher matcher = pattern.matcher(str);
         if ( matcher.find() ) {
                 System.out.println("TRUE");}
		}
		catch(IOException e)
		{System.out.print("IOOOO "+ e.toString());}
		catch(Exception e)
		{System.out.print(e.toString());}
	}

}
